package dream.service;

import dream.mapper.OperateMapper;
import dream.pojo.SignUpPojo;
import dream.util.SqlSessionFactoryUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;


public class OperateService {
    SqlSessionFactory factory = SqlSessionFactoryUtils.getSqlSessionFactory();
    public void InsertSignUpPojo(String name, String email, int parseInt, String message, long time){
        System.out.println(name);
        System.out.println(email);
        //2. 获取SqlSession对象
        SqlSession sqlSession = factory.openSession();
        //3. 获取Mapper
        OperateMapper mapper = sqlSession.getMapper(OperateMapper.class);

        mapper.insertSignUpPojo(name, email, parseInt, message, time);
        sqlSession.commit();
        sqlSession.close();
    }
}
